//
//  ImageText_NextView.m
//  Doctor
//
//  Created by 阳光 on 16/9/21.
//  Copyright © 2016年 阳光. All rights reserved.
//

#import "ImageText_NextView.h"

@implementation ImageText_NextView

-(instancetype)initWithTitle:(NSString *)title hasNext:(BOOL)next
{
    if (self=[super init]) {
        self.leftTitle=title;
//        self.imageIcon.hidden=NO;
        self.leftTitleLabel.textColor=Color333333;
//        self.arrowBtn.hidden=NO;
        if (next)
        {
            
        }
        self.backgroundColor=WhiteColor;
    }
    return self;
}

// 预防
- (instancetype)init {
    if (self = [super init]) {
        NSAssert1(NO, @"%s  必须使用initWithTitle:方法初始化", __FUNCTION__);
    }
    return self;
}

//-(UIImageView *)imageIcon
//{
//    if (_imageIcon==nil) {
//        _imageIcon=[UIImageView new];
//        //        _imageIcon.backgroundColor=Main_Color;
//        _imageIcon.image=[UIImage imageNamed:@"addIcon"];
//        [self addSubview:_imageIcon];
//        [_imageIcon mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.left.top.mas_equalTo(kmargin);
//            make.size.mas_equalTo(CGSizeMake(kmargin,kmargin));
//        }];
//    }
//    return _imageIcon;
//}

- (UILabel *)leftTitleLabel
{
    if (!_leftTitleLabel) {
        _leftTitleLabel=[UILabel new];
        [self addSubview:_leftTitleLabel];
        [_leftTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.centerY.mas_equalTo(self.imageIcon);
//            make.left.mas_equalTo(self.imageIcon.mas_right).mas_equalTo(kmargin/2);
             make.left.mas_equalTo(kmargin/2);
            make.width.mas_equalTo(150);
        }];
        _leftTitleLabel.font = [UIFont systemFontOfSize:13];
        _leftTitleLabel.text = _leftTitle;
    }
    return _leftTitleLabel;
}


@end
